<div class="content">

	<div class="header">
		<div class="page-title">
                    <div>
                        <h1><i class="icon-file-alt"></i><?php echo $box_title; ?></h1>
                        <h4> <?php echo $box_title; ?></h4>
                    </div>
        </div>		
	</div>

	<div class="container-fluid">
		<div class="row-fluid">

			<div class="clearfix">
				<div class="pull-left">
					<div class="btn-toolbar">
					
					</div>				
				</div>
				<div class="pull-right">
					<div class="btn-toolbar">
						<a href="<?php echo site_url('amway/question/add'); ?>" class="btn btn-primary"><i class="icon-plus"></i> Thêm mới</a>			
					</div>				
				</div>
			</div>			
			
            <!-- BEGIN Main Content -->
			<div class="row-fluid">
                    <div class="span12">
                        <div class="box">
                            <div class="box-title">
                                <h3><i class="icon-table"></i><?php echo $box_action; ?></h3>
                                <div class="box-tool">
                                </div>
                            </div>
                            <div class="box-content">
                            <form class="form-horizontal" >
								<div class="control-group">
                                       <label class="control-label">Phân loại :</label>
                                       <div class="controls">
                                          <select id="selCat" name="selCat" tabindex="1" class="input-xxlarge">
                                          	<option value="<?php echo site_url('amway/question/list'); ?>">-- Tất cả --</option>
                                          	<?php foreach ($rsCats as $rowCat) :
                                          				$selected =  ($rowCat['id'] == $cat_id ? "selected='selected'" : "");
                                          	?>
                                          	<option value="<?php echo site_url('amway/question/list/'.$rowCat['id']); ?>" <?php echo $selected?> >
                                          		<?php echo h($rowCat['title']);?>
                                          	</option>
                                          	<?php endforeach; ?>
                                          </select>
                                       </div>
                                </div>                            
                            </form>
                                <table class="table table-striped table-hover fill-head">
                                    <thead>
                                        <tr>
                                            <th width="2%">#</th>
                                            <th width="3%"></th>
                                            <th>Question</th>
                                            <th style="text-align: center" width="60px">Active</th>
                                            <th style="width: 70px">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    
                                    <?php
                                    	$i = 1; 
                                    	foreach ($rsContent as $rowContent) :
                                    ?>
                                    
									<tr>
										<td><?php echo $i; ?></td>
										<td></td>
                                        <td>
                                        	<?php echo h($rowContent["question"]); ?>
                                        	<br><br>
                                        	<span class="time"><i class="icon-time"></i> <?php echo $rowContent['create_at']; ?></span>
                                        	<br>
                                        	<a href="<?php echo site_url('amway/comment/list/'.$rowContent["id"]); ?>">Comments</a>
                                        </td>
                                        
                                        <td style="text-align: center">
                                            <?php if ($rowContent['active'] == 1) : ?>
                                            	<a href='#' title='Active' class='btn btn-circle btn-lime'><i class="icon-ok-sign"></i></a>
                                            <?php else : ?>
                                            	<a href='#' title='UnActive' class='btn btn-circle btn-gray'><i class="icon-remove-circle"></i></a>
                                            <?php endif; ?>                                            
                                        </td>
										
										<td>	
											<div class="btn-group">
												<a class="btn btn-small btn-gray" title="" href="<?php echo site_url("amway/question/edit/{$rowContent['id']}")?>"><i class="icon-edit"></i></a>		
												<a class="btn btn-small btn-danger" title="" href="javascript:confimDelete('<?php echo site_url("amway/question/delete/{$rowContent['id']}")?>');"><i class="icon-trash"></i></a>	
											</div>
										</td>
									</tr>                                    
                                    
                                    <?php
                                    		$i++; 
                                    	endforeach; 
                                    ?>
                                        
                                    </tbody>
                                </table>
                            
								<div class="pagination text-right">
								<?php
									// Make your db query here. Include $pages->limit as described in step 8.	(i.e. SELECT id,fname,lname FROM employees $pages->limit)
									//echo $pages->display_jump_menu(); // Optional – displays the page jump menu									
									echo $pages->display_pages(); // Optional call which will display the page numbers after the results.
								?>
								
	                            </div>                 
	                            
<!-- 								<div class="pagination text-right"> -->
<!--                                     <ul> -->
<!--                                         <li><a href="#">← Prev</a></li> -->
<!--                                         <li><a href="#">1</a></li> -->
<!--                                         <li><a href="#">2</a></li> -->
<!--                                         <li class="active"><a href="#">3</a></li> -->
<!--                                         <li><a href="#">4</a></li> -->
<!--                                         <li><a href="#">5</a></li> -->
<!--                                         <li><a href="#">6</a></li> -->
<!--                                         <li><a href="#">Next → </a></li> -->
<!--                                     </ul> -->
<!-- 	                            </div>	                                        -->
                            
                            </div>
                            
                        </div>
                    </div>
			</div>
			<!-- END Main Content -->
                			
			
		</div>
	</div>
</div>

<script type="text/javascript">

$(document).ready(function(){
	$("#selCat" ).change(function() {
		// Check input( $( this ).val() ) for validity here
		location.href = $(this).val();
		  
	});
});								
								
</script>


